Re: filtering on/off - how to apply to non-current module? llandale - Wed Sep 30 09:59:13 EDT 2009
Lets not confuse 'current' with 'original' module. Usually when you open a module it becomes 'current'.
There are other commands that presume the 'current' module, mostly dealing with attributes. These commands should routinely be surrounded as follows:
Module mCurr = current()
current = mod // Module I want to presume to be current
filtering off // or other presumptive commands
if (!null mCurr) current = mCurr // Reset the 'current'
You cannot set the current module to null, thus the 'if (!null mCurr)' command. Note that if there was actually no 'current' module, there will be after the above code; I have yet to find a case where that matters.
If you are having trouble with these presumptive commands you should insert some sort of
print "Current module = " name(current Module) "\n" before such commands.
|